package panda.rmi.client.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import panda.rmi.client.StatementAdapter;
import panda.rmi.server.ServerResultSet;
import panda.rmi.server.ServerStatement;

public class PandaStatement extends StatementAdapter {
	private ServerStatement stm;
	
	PandaStatement(ServerStatement stm) {
		this.stm = stm;
	}
	
	public ResultSet executeQuery(String q) throws SQLException {
		try {
			ServerResultSet rs = stm.executeQuery(q);
			return new PandaResultSet(rs);
		}
		catch (Exception e) {
			throw new SQLException(e);
		}
	}
	
	public int executeUpdate(String q) throws SQLException {
		try {
			return stm.executeUpdate(q);
		}
		catch (Exception e) {
			throw new SQLException(e);
		}
	}
	
}
